<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div:lang(en) {
        color: red;
      }
      /* div:lang(zh-CN) {
        color: green;
      } */
      :lang(zh-CN) {
        color: green;
      }
    </style>
  </head>
  <body>
    <div>第一个</div>
    <div lang="en">你好</div>
    <span>前端</span>
    <p>java</p>
  </body>
</html>
